<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <table id ="tab"></table>
    <script>
        let rejson = {
            code:200,
            msg :'success',
            data:[
                {sno:1,sname:"张三",age:13},
                {sno:2,sname:"李四",age:15},
            ]
        }

        let trs="";
        for(let p of rejson.data){
            trs += `
                <tr>
                    <td>${p.sno}</td>
                    <td>${p.sname}</td>
                    <td>${p.age}</td>
                </tr>
            `;
        }
       
        document.getElementById("tab").innerHTML = trs

        //raw 不会把当前字会里面的转义字符，做为真实功能处理
        let a = String.raw`h1! \n world`;

        if(a == `h1! \n world`){
            console.log(1111)
        }

        let x = 23;
        let y = 56;
        //求当前数组的最大值
        let arr1 = [1,2,3,345];
        console.log(Math.max(arr1[0],arr1[1],arr1[2]))

        //如果你用的方法是...动态参数的话，我们可以把数据通过展开方式，直接调用 ...arr1
        console.log(Math.max(...arr1));

        let arr2 = [1,2,3,4,5,6,7,8,90];

        let arr22 = [90,89,78];

        let arr222 = [...arr2,...arr22];
        console.log(arr222);

        let arr3 = [...arr2];

        let arr4 = arr2;

        console.log(arr3,arr2 == arr3,arr2 === arr4);

        const [first, ...rest] = [1, 2, 3, 4, 5];
        console.log(first,rest)

        const str1 = [...'abcd'];
        const [str2,str3] = [...'abcd'];

        console.log(str1,str2,str3)

    </script>
</body>
</html>